home *** CD-ROM | disk | FTP | other *** search
- //---------------------------------------------------------------------------
- #include <vcl\vcl.h>
- #pragma hdrstop
-
- #include "Raten1.h"
- //---------------------------------------------------------------------------
- #pragma resource "*.dfm"
- TForm1 *Form1;
- int Eingabe, Zufall;
- //---------------------------------------------------------------------------
- __fastcall TForm1::TForm1(TComponent* Owner)
- : TForm(Owner)
- {
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::Button1Click(TObject *Sender)
- {
- Edit1->SetFocus ();
- Eingabe = StrToInt (Edit1->Text);
- if (Eingabe == Zufall) Label1->Caption = "Richtig geraten!";
- if (Eingabe < Zufall) Label1->Caption = "Deine Zahl ist zu klein!";
- if (Eingabe > Zufall) Label1->Caption = "Deine Zahl ist zu gro▀!";
- }
- //---------------------------------------------------------------------------
- void __fastcall TForm1::FormCreate(TObject *Sender)
- {
- randomize ();
- Zufall = random (1000) + 1;
- }
- //---------------------------------------------------------------------------